import { Injectable } from '@nestjs/common';
import { CreateAgentManagDto } from './dto/create-agent_manag.dto';
import {
  UpdateAgentManagDto,
  NewsPaginationParams,
} from './dto/update-agent_manag.dto';

@Injectable()
export class AgentManagService {
  create(createAgentManagDto: CreateAgentManagDto) {
    return 'This action adds a new agentManag';
  }

  findAll(params: NewsPaginationParams) {
    const list: any[] = [];
    for (
      let index = (params.current - 1) * params.size;
      index < params.current * params.size;
      index++
    ) {
      list.push({
        id: index + 1,
        name: 'agent' + index,
        age: 25 + index,
        email: 'agent' + index + '@email.com',
        phone: '1234567890',
      });
    }

    return {
      list,
      total: 200,
    };
  }

  findOne(id: number) {
    return `This action returns a #${id} agentManag`;
  }

  update(id: number, updateAgentManagDto: UpdateAgentManagDto) {
    return `This action updates a #${id} agentManag`;
  }

  remove(id: number) {
    return `This action removes a #${id} agentManag`;
  }
}
